import { DataByPage, RESPONSE } from "../Types/Api/base"
import { CommentItem } from "../Types/Api/comment"
import { request } from "./base"

enum API {
  GET_COMMENTS_BY_ISUUE_ID = "/api/comment/issuecomment/",
  ADD_COMMENT = "/api/comment",
}

export const reqGetCBIID = (
  id: string,
  data: { current: number; pageSize: number }
) =>
  request.get<null, RESPONSE<DataByPage<CommentItem>>>(
    API.GET_COMMENTS_BY_ISUUE_ID + id,
    {
      params: data,
    }
  )

export const reqAddComment = (data: CommentItem) =>
  request.post(API.ADD_COMMENT, data)
